﻿
@{
    ViewBag.Title = "ConvertKaoHeBiao";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Template/ace_admin_v1.4.0/components/_mod/fuelux/tree.js"></script>
<div class="row" id="app">
    <div class="col-xs-12">
        <!--科室-->
        <div class="row" id="keshidiv">
            <div class="col-xs-12">
                <!--搜索-->
                <div class="row">
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <i class="ace-icon fa fa-check"></i>
                            </span>

                            <input type="text" class="form-control search-query" placeholder="输入科室名称">
                            <span class="input-group-btn">
                                <button type="button" class="btn btn-inverse btn-white">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    查找
                                </button>
                            </span>
                        </div>
                        <div class="hr"></div>
                    </div>
                </div>
                <!--科室列表-->
                <div class="row">
                    <div class="col-xs-12">
                        <table id="simple-table" class="table  table-bordered table-hover">
                            <thead>
                                <tr>

                                    <th>科室名称</th>
                                    <th>包含职务</th>
                                    <th></th>
                                </tr>
                            </thead>

                            <tbody>
                                <tr v-for="item in keshilist">

                                    <td>{{item.ksmc}}</td>
                                    <td>
                                        {{item.ZhiWustr}}
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-primary btn-white dropdown-toggle btn-sm " aria-expanded="true">
                                                操作
                                                <i class="ace-icon fa fa-angle-down icon-on-right"></i>
                                            </button>

                                            <ul class="dropdown-menu">
                                                <li>
                                                    <a href="javascript:void(0)" v-on:click="KHBConverDFB(item.ksid)">生成得分表</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="~/Scripts/JsModel/Model_KeShi.js"></script>
<script type="text/javascript">
    var vm = new Vue(
        {
            el: "#app",
            data: {
                keshilist: []
            },
            mounted() {
                this.initPage();
            },
            methods: {
                initPage: function () {
                    var _self = this;
                    _self.GetAllKeShi();
                   },
                GetAllKeShi: function() { //获取全部科室
                    var _self = this;
                    axios.get("@Url.Action("GetAllKeShi", "KeShiConfig")").then((response) => {
                            _self.keshilist = [];
                            for (var i = 0; i < response.data.length; i++) {
                                _self.keshilist.push(new KeShi(response.data[i]));
                            }
                        },
                        (response) => {

                        }
                    ).catch(function(response) {
                        console.log(response);
                    });
                },
                KHBConverDFB: function (ksid) {
                    ///<summary>考核表转换为得分表</summary>
                    var _self = this;
                    axios.get("@Url.Action("CreateKaoHeDeFenBiao", "Review")", { params: { ksid: ksid } }).then((response) => {
                            bootbox.alert("成功");
                        },
                        (response) => {

                        }
                    ).catch(function(response) {
                        console.log(response);
                    });
                }
            }
        });
</script>